using NDesk.Options;

namespace JoePack
{
    public static class ArgumentParser
    {
        public static OptionSet Parse(string[] args, out string catalogPath, out string solutionPath, out bool showHelp)
        {
            var cPath = "catalog.xml";
            var sPath = "";
            var show_help = false;
            var p = new OptionSet()
                        {
                            {"c|catalog=", "The path of the catalog listing all packages used @Fluxys.", v => cPath = v},
                            {"s|solution=", "The root path of the soltution folder, this is where the dependency.xml should be found.", v => sPath = v},
                            { "h|help",  "show this message and exit", v => show_help = v != null },
                        };
            var extra = p.Parse(args);

            catalogPath = cPath;
            solutionPath = sPath;
            showHelp = show_help;

            return p;
        }
    }
}